Skip to content

Conversation

@namewhat99
Copy link
Contributor

@namewhat99 namewhat99 commented May 17, 2024

이슈

체크리스트

  • 로그가 2번 찍히는 문제 해결
  • 로그에 body 정보도 함께 기록

고민한 내용

  • RequestBody 는 stream 이므로 한번 밖에 소비되지 못한다. 이 문제를 해결해야 했음

    • fitler 를 추가해서 dispatcherServlet 에 들어오기 전에 request 를 ContentWrapper 클래스로 변환하여 해결
    • 위 과정을 interceptor 의 preHandle 을 통해 처리할 수 있을까 고민했는데 해당 방법은 찾지 못했다.
  • ArguementResolver 를 통해 처리된 exception 은 interceptor 의 afterCompletion 까지 전파되지 않는다

    • ControllerAdvice 에서 처리된 exception 들은 더 이상 전파되지 않는다. interceptor 의 afterCompletion 은 controllerAdvice 가 실행된 이후에 수행되므로 exception 이 전파되지 않음
    • response status 를 통해 로그를 나눠서 작성하는 방법으로 구현

@namewhat99 namewhat99 requested a review from koomin1227 May 17, 2024 07:23
@namewhat99 namewhat99 self-assigned this May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants